# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Balló György <ballogyor+arch at gmail dot com>

pkgname=rygel
pkgver=0.40.2
pkgrel=1
epoch=1
pkgdesc="UPnP AV MediaServer and MediaRenderer"
url="https://wiki.gnome.org/Projects/Rygel"
arch=(x86_64)
license=(LGPL)
depends=(gupnp gupnp-av gupnp-dlna libgee gtk3 libunistring tracker3
         libmediaart gst-editing-services)
makedepends=(vala gobject-introspection git meson)
optdepends=('gst-plugins-base: Extra media codecs'
            'gst-plugins-good: Extra media codecs'
            'gst-plugins-bad: Extra media codecs'
            'gst-plugins-ugly: Extra media codecs'
            'gst-libav: Extra media codecs'
            'tracker3-miners: Share indexed media files')
backup=(etc/rygel.conf)
groups=(gnome)
_commit=4cc71529e53acaae16957d38a6565396a7ebf6b4  # tags/rygel-0.40.2^0
source=("git+https://gitlab.gnome.org/GNOME/rygel.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^RYGEL//;s/^rygel-//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgname
  git cherry-pick -n d0410cccf6af55e16d3ba9400ad5e9f703313739
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}
